/*
 * Copyright (C) Francisco Morero Peyrona. All rights reserved.
 *
 * This software is published under the terms of Open Source 
 * License version 1.1, a copy of which has been included with this
 * distribution in the License.txt file.  
 */

package jdbcmanager.dbtools.datatypes;

/**
 * 
 * @author Francisco Morero Peyrona
 */
public final class UDTDefinition extends DbEntityDefinition
{
   private String sClassName;
   private int    nDataType;
   private String sComments;
   
  //-------------------------------------------------------------------------//

  /**
   * Argument zero class constructor
   */
   public UDTDefinition()
   {
      this( null );
   }

  /**
   * Class constructor.
   * 
   * @param td An instance of <code>DbEntityDescriptor</code>
   */
   public UDTDefinition( DbEntityDescriptor td )
   {
      this( td, null, -1, null );
   }
   
   /**
    * Class constructor.
    * 
    * @param td
    * @param sClassName
    * @param nDataType
    * @param sComments
    */
   public UDTDefinition( DbEntityDescriptor td, String sClassName, int nDataType, String sComments )
   {
      super( td );
      
      this.sClassName = sClassName;
      this.nDataType  = nDataType;
      this.sComments  = sComments;
   }

   
   public int    getDataType()     { return this.nDataType;  }
   public String getDataTypeName() { return JDBCTypeConverter.getJdbcTypeName( getDataType() ); }
   public String getClassName()    { return this.sClassName; }
   public String getComments()     { return this.sComments;  }
   public String getName()         { return ded.getName();   }
   
   public void setDataType( int n )    { this.nDataType  = n; }
   public void setClassName(String s ) { this.sClassName = s; }
   public void setComments(String s )  { this.sComments  = s; }
}